﻿using System.Windows.Media.Media3D;

namespace Wen.UI.NavigationElements
{
    internal class SpotLightDirectionViewModel : XyzControlViewModelBase
    {
        private readonly Vector3D _stockDirection;
        private readonly SpotLight _spotLight;

        internal SpotLightDirectionViewModel(SpotLight spotLight) {
            _stockDirection = spotLight.Direction;
            _spotLight = spotLight;
        }

        protected override void ApplyXMovement(double step) {
            _spotLight.Direction += new Vector3D(step, 0, 0);
        }

        protected override void ApplyYMovement(double step) {
            _spotLight.Direction += new Vector3D(0, step, 0);
        }

        protected override void ApplyZMovement(double step) {
            _spotLight.Direction += new Vector3D(0, 0, step);
        }

        protected override void Reset() {
            _spotLight.Direction = _stockDirection;
        }

    	protected override Point3D RawCoords
    	{
    		get { return new Point3D(_spotLight.Direction.X, _spotLight.Direction.Y, _spotLight.Direction.Z); }
    	}
    }
}
